package net.sareweb.acab.entity;

// Generated 20-abr-2010 10:59:51 by Hibernate Tools 3.2.5.Beta

import java.util.Date;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import org.hibernate.validator.NotNull;

/**
 * Dialog generated by hbm2java
 */
@Entity
@Table(name = "dialog", catalog = "acab")
public class Dialog implements java.io.Serializable {

	private Integer idDialog;
	private Travel travel;
	private User user;
	private Date createDate;
	private Date updateDate;
	private Date deleteDate;
	private Date lastCommentDate;
	private Date ownerSeenDate;
	private Date otherSeenDate;
	private Set<Comment> comments = new HashSet<Comment>(0);

	public Dialog() {
	}

	public Dialog(Travel travel, User user, Date createDate) {
		this.travel = travel;
		this.user = user;
		this.createDate = createDate;
	}

	public Dialog(Travel travel, User user, Date createDate, Date updateDate,
			Date deleteDate, Date lastCommentDate, Date ownerSeenDate,
			Date otherSeenDate, Set<Comment> comments) {
		this.travel = travel;
		this.user = user;
		this.createDate = createDate;
		this.updateDate = updateDate;
		this.deleteDate = deleteDate;
		this.lastCommentDate = lastCommentDate;
		this.ownerSeenDate = ownerSeenDate;
		this.otherSeenDate = otherSeenDate;
		this.comments = comments;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "idDialog", unique = true, nullable = false)
	public Integer getIdDialog() {
		return this.idDialog;
	}

	public void setIdDialog(Integer idDialog) {
		this.idDialog = idDialog;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "travel", nullable = false)
	@NotNull
	public Travel getTravel() {
		return this.travel;
	}

	public void setTravel(Travel travel) {
		this.travel = travel;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "user", nullable = false)
	@NotNull
	public User getUser() {
		return this.user;
	}

	public void setUser(User user) {
		this.user = user;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "createDate", nullable = false, length = 0)
	@NotNull
	public Date getCreateDate() {
		return this.createDate;
	}

	public void setCreateDate(Date createDate) {
		this.createDate = createDate;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "updateDate", length = 0)
	public Date getUpdateDate() {
		return this.updateDate;
	}

	public void setUpdateDate(Date updateDate) {
		this.updateDate = updateDate;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "deleteDate", length = 0)
	public Date getDeleteDate() {
		return this.deleteDate;
	}

	public void setDeleteDate(Date deleteDate) {
		this.deleteDate = deleteDate;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "lastCommentDate", length = 0)
	public Date getLastCommentDate() {
		return this.lastCommentDate;
	}

	public void setLastCommentDate(Date lastCommentDate) {
		this.lastCommentDate = lastCommentDate;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "ownerSeenDate", length = 0)
	public Date getOwnerSeenDate() {
		return this.ownerSeenDate;
	}

	public void setOwnerSeenDate(Date ownerSeenDate) {
		this.ownerSeenDate = ownerSeenDate;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "otherSeenDate", length = 0)
	public Date getOtherSeenDate() {
		return this.otherSeenDate;
	}

	public void setOtherSeenDate(Date otherSeenDate) {
		this.otherSeenDate = otherSeenDate;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "dialog")
	public Set<Comment> getComments() {
		return this.comments;
	}

	public void setComments(Set<Comment> comments) {
		this.comments = comments;
	}

}
